import { NgModule } from '@angular/core';
import { Routes, RouterModule } from '@angular/router';
import { HeroesComponent} from './heroes/heroes.component'
import { ProfileEditorComponent} from './profile-editor/profile-editor.component'
import { DashboardComponent} from './dashboard/dashboard.component'
import { HeroDetailComponent } from './hero-detail/hero-detail.component'
import { TestComponent } from './test/test.component'

const routes: Routes = [
  // { path: '', redirectTo: '/', pathMatch: 'full' },//不需要
  { path: 'heroes', component: HeroesComponent },
  { path: 'profile', component: ProfileEditorComponent },
  // { path: 'test', component: TestComponent },
  // { path: 'login', redirectTo: '/login', pathMatch: 'full' },
  // { path: '**', redirectTo: '/' }//不需要
  
];


@NgModule({
  imports: [ 
    RouterModule.forRoot(routes, { useHash: true })
  ],  
  exports: [ 
    RouterModule
  ]
})

export class AppRoutingModule { }
